module.exports ={
	getuser(){
		return new Promise((r,s)=>{
			uni.getUserProfile({
				desc:'获取用户信息',
				success: (res) => {
					let data={
						avatarUrl:res.avatarUrl,
						gender:res.gender,
						nickName:res.nickName
					}
					this.$u.api.getUserInfo(data).then(re=>{
						console.log(re,'fffffffffff')
						this.$u.vuex('vuex_user', re);
					})
					console.log(res.userInfo)
				}
			})
		})
		
	},
	ttpay(data){
		return new Promise((r,n)=>{
			uni.requestPayment({
			    "provider": "toutiao", 
			    "orderInfo": {
			        order_id: data.order_id,
			        order_token:data.order_token
			      },
			    success:(res)=> {
					uni.showToast({
						title:'付款成功'
					})
					// uni.navigateTo({
					// 	url:'/pages/shops/payOk'
					// })
					r(1)
				},
			    fail:(e)=> {
					uni.showToast({
						title:e.errMsg,
						icon:'none'
					})
					r(e)
				}
			})
		})
	},
	
}